package com.huawei.crm.sample.application.order.validator;

import com.huawei.crm.sample.application.order.dto.OrderDTO;

public class OrderValidator {
    public static void validateForPlaceOrder(OrderDTO orderDTO) {
        if (orderDTO == null) throw new IllegalArgumentException("订单参数不能为空");
        if (orderDTO.getCustomerId() == null || orderDTO.getCustomerId().isEmpty()) throw new IllegalArgumentException("客户ID不能为空");
        if (orderDTO.getItems() == null || orderDTO.getItems().isEmpty()) throw new IllegalArgumentException("订单项不能为空");
    }
} 